require "Main"
require "Project/Common/Common"
require "Project/Common/ProxyBind"
require "Project/Engine/EventType"
require "Project/Engine/EventSet"
require "Project/Engine/EventManager"
require "Project/Test"
require "Project/Engine/Loading"
require "Project/Scene/MainScene"


function main()
	local button=GameObject.Find("Login"):GetComponent(UnityEngine.UI.Button.GetClassType());
	setStartProxy(GameObject.Find("Login"),onStart);
	button.onClick:AddListener(doClick);
	local root=getRootManager();
	root.OnLevelWasLoadedProxy=root.OnLevelWasLoadedProxy+DelegateFactory.Action_int(onLevelLoaded);
	EventManager.registEvent(EventType.OnLevelLoaded,func);
end
function doClick()
	Loading.loadModule(MainScene,"Main");
end
function onStart(o)
	--print(o.name);
end
function onLevelLoaded(level)

	EventManager.notifyEvent(EventType.OnLevelLoaded,level);
end
function func(eventType,owner,level)
	print(level);
end